import { HANDLE_LOGIN_STATUS, HANDLE_LOGIN } from './../type'
import { postPayrollSelcetH5 } from '@/APIs/index/index'

const actions = {
	async handleLoginStatus({ dispatch, commit }, { code, state, spmId, userAccount }) {
		await dispatch('handleSelectContent', { code, state, spmId, userAccount })
		commit(HANDLE_LOGIN_STATUS, true)
	},
	async handleSelectContent({ commit }, { code, state, spmId, userAccount }) {
		const { data } = await postPayrollSelcetH5({ code, state, spmId, userAccount })
		commit(HANDLE_LOGIN, data)
	}
}

export default actions
